<template>
  <el-card body-style="padding-top:10px" class="mt15">
    <div slot="header" class="bold">
      {{ title }}
    </div>
    <v-tableBtns
      :show-export="false"
      :show-create="showCreate"
      box-style="padding-bottom:10px"
      @addNew="addNew"
    />
    <v-table
      :table-title="tableTitle"
      :table-data="tableData"
      :default-operate="defaultOperate"
      :select="false"
      width="180px"
      @edit="edit"
      @del="del"
    />
  </el-card>
</template>

<script>
  export default {
    name: 'RecordTable',
    props: {
      title: {
        type: String
      },
      tableTitle: {
        type: Array
      },
      tableData: {
        type: Array
      },
      showCreate:{
        type:Boolean,
        default:true
      },
      defaultOperate:{
        type:Boolean,
        default:true
      },
    },
    methods: {
      addNew() {
        this.$emit('addNew')
      },
      edit(val) {
        this.$emit('edit', val)
      },
      del(val) {
        this.$emit('del', val)
      }
    }
  }
</script>

<style scoped>
  .el-button + .el-button {
    margin-left: 5px;
  }
</style>
